#include<iostream>
using namespace std;

class A {
private:
	int a;
	friend int getA(A* aObj);
public:
	A(int number) {
		a = number;
	}
};

int getA(A* aObj) {
	if (aObj != NULL) {
		return aObj->a;
	}
	return -1;
}
int main(){

	A a(10);
	int n = getA(&a);
	cout << n << endl;
	return 0;
}